Leaflet Map Transformation—表示仿射变换

Leaflet Map Transformation—表示仿射变换

表示仿射变换:一组系数a,b,c,d,用于将形式(x,y)的点变换为(a*x+b,c*y+d)并进行相反的变换。由Leaflet在其投影代码中使用。

Usage example

var transformation = L.transformation(2, 5, -1, 10),
    p = L.point(1, 2),
    p2 = transformation.transform(p), //  L.point(7, 8)
    p3 = transformation.untransform(p2); //  L.point(1, 2)

Creation

FactoryDescription
L.transformation(<Number> a,
 <Number> b, <Number>
 c, <Number> d)
Instantiates a Transformation object with the given coefficients.
使用给定的系数实例化Transformation对象。
L.transformation(<Array> 
coefficients)
Expects an coefficients array of the form [a: Number, b: Number, c: Number, d: Number].
应为[a:Number,b:Number,c:Number,d:Number]形式的系数数组。

Methods

MethodReturnsDescription
transform(<Point
point, <Number> scale?)
PointReturns a transformed point, optionally multiplied by the given scale. Only accepts actual L.Point instances, not arrays.
返回变换后的点,可以选择乘以给定的比例。仅接受实际L。点实例,而不是数组。
untransform(<Point
point, <Number> scale?)
PointReturns the reverse transformation of the given point, optionally divided by the given scale. Only accepts actual L.Point instances, not arrays.
返回给定点的反向变换,可以选择除以给定比例。仅接受实际L。点实例,而不是数组。
0 0 投票数
文章评分
订阅评论
提醒
0 评论
最旧
最新 最多投票
内联反馈
查看所有评论
0
希望看到您的想法,请您发表评论x